<?php
class Location_model extends CI_Model{
	var $name;
	var $description;
	var $coordinate;
	
	function __construct(){
		parent::__construct();
	}
	
	function findById($entryId){
		$this->db->where('id', $entryId);
		$row = $this->db->get('location')->row_array();
		return $row;
	}
	
	function findByName($addressName){
		$this->db->like('name', $addressName);
		$query = $this->db->get('location');
		$rows = array();
        foreach ($query->result_array() as $row){
            $rows[] = $row;
        }
		return $rows;
	}
	
	function findHot(){
		$this->db->where('status', 'ACTIVE');
		$query = $this->db->get('location');
		$rows = array();
        foreach ($query->result_array() as $row){
            $rows[] = $row;
        }
		return $rows;
	}
	
}